<!DOCTYPE html>
<html lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>安装通数据分析平台</title>

    <!-- Bootstrap -->
    <link href="/res/vendors/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome -->
    <link href="/res/vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
    <!-- NProgress -->
    <link href="/res/vendors/nprogress/nprogress.css" rel="stylesheet">
    <!-- Animate.css -->
    <link href="/res/vendors/animate.css/animate.min.css" rel="stylesheet">

    <!-- Custom Theme Style -->
    <link href="/res/build/css/custom.min.css" rel="stylesheet">

    <!-- jQuery -->
    <script src="/res/vendors/jquery/dist/jquery.min.js"></script>
    <!-- Bootstrap -->
    <script src="/res/vendors/bootstrap/dist/js/bootstrap.min.js"></script>
    <!-- FastClick -->
    <script src="/res/vendors/fastclick/lib/fastclick.js"></script>
    <!-- NProgress -->
    <script src="/res/vendors/nprogress/nprogress.js"></script>
    <!-- validator -->
    <script src="/res/vendors/validator/validator.js"></script>
    <!--layer.js-->
    <script src="/res/layer/layer.js"></script>
    <script type="text/javascript">

      function logToReport() {
        if(validator.checkAll($('#logForm'))){
          $.ajax({
            url :'/login' ,
            type : 'post' ,
            dataType : 'json' ,
            data : $("#logForm").serialize(),
            beforeSend : function() {
              NProgress.start();
            },
            success: function (resJson) {
              if(resJson.success) {
                location.href = "/";
              }else{
                layer.msg(resJson.msg , {time : 1000});
              }
            },
            error : function (x , t , e) {
              alert("错误："+x.status+"--"+x.responseText);
            },
            complete : function () {
              NProgress.done();
            }
          });
        }

        return false;
      }
    </script>
  </head>

  <body class="login">
    <div>
      <a class="hiddenanchor" id="signup"></a>
      <a class="hiddenanchor" id="signin"></a>

      <div class="login_wrapper">
        <div class="animate form login_form">
          <section class="login_content">
            <form id = "logForm" novalidate>
              <h1>Login Form</h1>
              <div class="item form-group">
                <input type="text" class="form-control" placeholder="Username" required="required" name="userName" onkeypress="if(event.keyCode == 13){logToReport();}"/>
              </div>
              <div>
                <input type="password" class="form-control" placeholder="Password" required="required" name="password" onkeypress="if(event.keyCode == 13){logToReport();}"/>
              </div>
              <div>
              </div>

              <div>
                <button id="send" type="button" class="btn btn-success" onclick="logToReport();">Log in</button>
                <!--<a class="reset_pass" href="#">Lost your password?</a>-->
              </div>

              <div class="clearfix"></div>

              <div class="separator">
                <p class="change_link">New to site?
                  <a href="#signup" class="to_register"> Create Account </a>
                </p>

                <div class="clearfix"></div>
                <br />

                <div>
                  <h1><i class="fa fa-bar-chart"></i> 安装通数据分析平台</h1>
                  <p>©2016 All Rights Reserved. Gentelella Alela! is a Bootstrap 3 template. Privacy and Terms</p>
                </div>
              </div>
            </form>
          </section>
        </div>

        <div id="register" class="animate form registration_form">
          <section class="login_content">
            <form>
              <h1>Create Account</h1>
              <div>
                <input type="text" class="form-control" placeholder="Username" required="" />
              </div>
              <div>
                <input type="email" class="form-control" placeholder="Email" required="" />
              </div>
              <div>
                <input type="password" class="form-control" placeholder="Password" required="" />
              </div>
              <div>
                <a class="btn btn-default submit" href="index.html">Submit</a>
              </div>

              <div class="clearfix"></div>

              <div class="separator">
                <p class="change_link">Already a member ?
                  <a href="#signin" class="to_register"> Log in </a>
                </p>

                <div class="clearfix"></div>
                <br />

                <div>
                  <h1><i class="fa fa-paw"></i> Gentelella Alela!</h1>
                  <p>©2016 All Rights Reserved. Gentelella Alela! is a Bootstrap 3 template. Privacy and Terms</p>
                </div>
              </div>
            </form>
          </section>
        </div>
      </div>
    </div>

    <!-- Custom Theme Scripts -->
    <script src="/res/build/js/custom.min.js"></script>
  </body>
</html>
